home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
bbsutil
/
watchkat.zip
/
WATCHCAT.LST
< prev
next >
Wrap
File List
|
1989-08-23
|
26KB
|
495 lines
Turbo Assembler Version 1.0 11-21-89 20:57:32 Page 1
WATCHCAT.ASM
1 0000 .model tiny
2 0000 .code
3 0000 first:
4 ;
5 ; WATCHCAT copyright 1989, Joseph R. Ahlgren
6 ; see WATCHCAT.DOC
7 ;
8 ; WATCHCAT performs 5 critical functions for any RBBS system:
9 ; 1. Reboots system if no carrier in specified period of time
10 ; This catches RBBS or system failures
11 ; 2. Reboots system if carrier lost during critical period
12 ; This allows Doors to be used safely
13 ; 3. Reboots system if 20 rings without answering phone
14 ; This allows system to be restarted by phone
15 ; 4. Reboots system if "Hit any key to return to system" message appears
16 ; This restarts system on a common RBBS failure
17 ; 5. Drops carrier if L&R shift keys pressed simultaneously
18 ; This allows users to be logged off without a nasty message.
19 ;WATCHCAT loads the TSR and disables all functions
20 ; WATCHCAT OFF disables all functions
21 ; WATCHCAT ON enables 1,3,4,and 5
22 ; WATCHCAT TIMER enables 2,4,and 5
23 ;ComPort = 03f8h ;{COM1}
24 ;ComPort = 02f8h ;{COM2}
25 ;ComPort = 03e8h ;{COM3}
26 ;ComPort = 02e8h ;{COM4}
27 ;ScreenSegment = 0b800h ;{Color}
28 ;ScreenSegment = 0b000h ;{Mono}
29 = 0006 ModemStatus = 0006h
30 = 0004 ModemControl = 0004h
31 = 0080 CarrierDetect = 0080h
32 = 0040 RingIndicator = 0040h
33 = 0444 tpm = 1092 ; {ticks per minute}
34 = 006E RingTicks = 110; {6 seconds}
35 org 100h
36 0100 start:
37 0100 E9 010F jmp init
38 0103 0000 RingTrigger dw 0
39 0105 00 RingTimer db 0
40 0106 06 Flag db 'F' and 0fh ; OFF ON TIME = F O I
41 0107 ???????? TimerInt dd ?
42 010B 01E0 Minutes dw 8*60 ;{minutes of no carrier to trigger reset}
43 010D 0444 Seconds dw tpm
44 010F 01E0 MinReset dw 8*60
45 0111 FFFF0000 ColdBoot dd 0ffff0000h
46 0115 00 ExitTimer db 0
47 0116 03 DropTrigger db 3 ;Drop DTR on L&R shift
48 0117 48 69 74 20 61 6E 79 + ExitMessage db 'Hit any key to return to system'
49 20 6B 65 79 20 74 6F +
50 20 72 65 74 75 72 6E +
51 20 74 6F 20 73 79 73 +
52 74 65 6D
53 0136 00 ExitMessageEnd db 0
54 0137 02F8 ComPort dw 02f8h ;{COM2}
55 0139 B000 ScreenSegment dw 0b000h ;{Mono}
56 013B 6A 4F 65 59 Ident db "jOeY"
57 013F 35 30 63 34 Ident2 db "50c4"
58 0143 timer:
59 assume ds:nothing,es:nothing,ss:nothing
Turbo Assembler Version 1.0 11-21-89 20:57:32 Page 2
WATCHCAT.ASM
60 0143 2E: 80 3E 0106r 06 cmp cs:[Flag],'F' and 0fh
61 0149 75 05 jne SystemOn
62 014B 2E: FF 2E 0107r jmp cs:[TimerInt]
63 0150 SystemOn:
64 0150 50 push ax
65 0151 52 push dx
66 0152 1E push ds
67 ; 4. Reboots system if "Hit any key to return to system" message appears
68 ; This restarts system on a common RBBS failure
69 0153 2E: FE 0E 0115r dec cs:[ExitTimer]
70 0158 75 2C jnz NoExitLoop
71 015A 51 push cx
72 015B 56 push si
73 015C 57 push di
74 015D 2E: A1 0139r mov ax,cs:[ScreenSegment]
75 0161 8E D8 mov ds,ax
76 0163 B9 0019 mov cx,25
77 0166 33 F6 xor si,si
78 0168 SSLoop1:
79 0168 51 push cx
80 0169 56 push si
81 016A B9 001F mov cx,ExitMessageEnd-ExitMessage
82 016D BF 0117r mov di,offset ExitMessage
83 0170 SSLoop2:
84 0170 AD lodsw
85 0171 2E: 3A 05 cmp al,cs:[di]
86 0174 75 05 jne SSLoop2x
87 0176 47 inc di
88 0177 E2 F7 loop SSLoop2
89 0179 EB 6D jmp short NoCarrier
90 017B SSLoop2x:
91 017B 5E pop si
92 017C 59 pop cx
93 017D 81 C6 00A0 add si,160
94 0181 E2 E5 loop SSLoop1
95 0183 5F pop di
96 0184 5E pop si
97 0185 59 pop cx
98 0186 NoExitLoop:
99 ; 5. Drops carrier if L&R shift keys pressed simultaneously
100 ; This allows users to be logged off without a nasty message.
101 0186 33 C0 xor ax,ax
102 0188 8E D8 mov ds,ax
103 assume ds:Lowmem
104 018A A0 0417r mov al,[ShiftStatus]
105 018D 24 0F and al,0fh
106 018F 2E: 3A 06 0116r cmp al,cs:[DropTrigger]
107 0194 75 0C jne NoShift
108 0196 2E: 8B 16 0137r mov dx,cs:[ComPort]
109 019B 83 C2 04 add dx,ModemControl
110 019E EC in al,dx
111 ; or al,1
112 019F 24 FE and al,0feh
113 01A1 EE out dx,al ;drop DTR
114 01A2 NoShift:
115 ; 3. Reboots system if 20 rings without answering phone
116 ; This allows system to be restarted by phone
117 01A2 2E: 8B 16 0137r mov dx,[ComPort]
118 01A7 83 C2 06 add dx,ModemStatus
Turbo Assembler Version 1.0 11-21-89 20:57:32 Page 3
WATCHCAT.ASM
119 01AA EC in al,dx
120 01AB A8 40 test al,RingIndicator
121 01AD 74 06 jz NotRinging
122 01AF 2E: 83 0E 0103r 01 or cs:[RingTrigger],1
123 01B5 NotRinging:
124 01B5 2E: FE 0E 0105r dec cs:[RingTimer]
125 01BA 75 15 jnz NoRingTime
126 01BC 2E: C6 06 0105r 6E mov cs:[RingTimer],RingTicks
127 01C2 2E: A1 0103r mov ax,cs:[RingTrigger]
128 01C6 3D FFFF cmp ax,0ffffh
129 01C9 74 1D je NoCarrier
130 01CB D1 E0